﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Configuration;

namespace XMK.Tadong.Web.TJ
{
    public partial class DownFile : System.Web.UI.Page
    {
        private void Page_Load(object sender, System.EventArgs e)
        {

            try
            {
                string szFileName = Request.QueryString["FileName"];
                string szFilePath = Request.QueryString["FilePath"];
                szFilePath = szFilePath.Replace("*", "/");
                Page.Response.Clear();

                bool bSeced = DownLoad.ResponseFile(this.Request, this.Response, szFileName, szFilePath, Convert.ToInt64(ConfigurationSettings.AppSettings["DownSpeed"]));

                if (!bSeced)
                {
                    SysHelper.NotifyUser(this.Page, "录井图数据下载失败，请联系管理员");
                }

                Page.Response.End();

                SysHelper.CloseWin(this.Page);
            }
            catch (Exception er)
            {
                Session["ErrorInfo"] = er.ToString();
                System.Diagnostics.Debug.WriteLine(er.ToString());
            }

        }
    }
}